<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/conn.asp"-->
<!--#include file="lib/saferequest.asp"-->
<!--#include file="lib/error_write.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="lib/sheet.css" type="text/css">
<title>无标题文档</title>
</head>

<body>
<%
If (CStr(Request.form("mm_add")) <> "") Then
	user=trim(SafeRequest("user",0))
	name=trim(SafeRequest("name",0))
	flag=trim(SafeRequest("flag",1))
	post=trim(SafeRequest("post",1))
	if user="" then error_write "1","没有填写[用户名]"
	if name="" then error_write "2","没有填写[姓名]"

	pws=user&"12345678"
	'response.write username
	'response.Write password
	'response.write email
	'response.write sql


	set cmd=Server.CreateObject("ADODB.Command")
	cmd.ActiveConnection = conn
	'sql="insert into  admin(username,flag,password,email,name) values('"&username&"','"&flag&"','"&password&"','"&email&"','"&xm&"')"
	sql="insert into yh([user],[pass],flag,[name],post) values('"&user&"','"&pws&"',"&flag&",'"&name&"',"&post&")"
	'sql="insert into  admin(username,flag,email,name) values('"&username&"',"&flag&",'"&email&"','"&xm&"')"
	'response.Write(sql)
	cmd.CommandText = sql
	cmd.Execute
	cmd.ActiveConnection.Close
	view_url="manage_user.asp"
	response.Redirect(view_url)


end if

%>

<form name="form1" method="post" action="#">
<table cellspacing="1" cellpadding="2" border="0" bgcolor="black" width="100%">
	<tr bgcolor="silver">
		<th>用户名</th>
		<th>权限</th>
		<th>姓名</th>
		<th>岗位</th>
	</tr>
	<tr align="center" bgcolor="#efefef">
		<td><input name="user" type="text" size="20"></td>
		<td><select name="flag">
				<option value="1">查询</option>
				<option value="3">查询、添加</option>
				<option value="4">查询、添加、编辑</option>
				<option value="5">查询、添加、编辑、删除</option>
				<option value="15">管理员</option>
			</select></td>
		<td><input name="name" type="text" size="10"></td>
		<td>
			<select name="post">
				<option value="1">船务</option>
				<option value="2">车队</option>
				<option value="0">全部</option>
0			</select>
		</td>
	</tr>
	<tr bgcolor="silver">
		<td colspan="4" align="center"><input type="submit" name="Submit" value="提交">&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="Reset" value="重置"><input type="hidden" name="mm_add" value="true"></td>
	</tr>
</table>
</form>
<p><a href="javascript:history.go(-1)">&lt;&lt;返回上一页</a></p>
</body>
</html>

